package com.itheima.day03;

public class Test4 {
    public static void main(String[] args) {

        Pair<String, Integer> pair = Pair.of("hello", 123);
        System.out.println(pair.getFirst());
        System.out.println(pair.getSecond());
    }
}

class Pair<F, S> {
    private final F first;
    private final S second;


    private Pair(F first, S second) {
        this.first = first;
        this.second = second;
    }

    //static Pair<> of[F
     public static <F,S> Pair of(F first, S second) {
        return new Pair<>(first, second);
    }

    public S getSecond() {
        return second;
    }

    public F getFirst() {
        return first;
    }
}